package com.dianping.cat.consumer.matrix.model.entity;

import com.dianping.cat.consumer.matrix.model.BaseEntity;
import com.dianping.cat.consumer.matrix.model.IVisitor;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;





public class MatrixReport
  extends BaseEntity<MatrixReport>
{
  private String m_domain;
  private Date m_startTime;
  private Date m_endTime;
/*  21 */   private Set<String> m_domainNames = new LinkedHashSet();

/*  23 */   private Map<String, Matrix> m_matrixs = new LinkedHashMap();





  public MatrixReport(String domain) { this.m_domain = domain; }




/*  34 */   public void accept(IVisitor visitor) { visitor.visitMatrixReport(this); }


  public MatrixReport addDomain(String domain) {
/*  38 */     this.m_domainNames.add(domain);
/*  39 */     return this;
  }

  public MatrixReport addMatrix(Matrix matrix) {
/*  43 */     this.m_matrixs.put(matrix.getName(), matrix);
/*  44 */     return this;
  }


  public boolean equals(Object obj) {
/*  49 */     if (obj instanceof MatrixReport) {
/*  50 */       MatrixReport _o = (MatrixReport)obj;

/*  52 */       if (!equals(getDomain(), _o.getDomain())) {
/*  53 */         return false;
      }

/*  56 */       return true;
    }

/*  59 */     return false;
  }


/*  63 */   public Matrix findMatrix(String name) { return (Matrix)this.m_matrixs.get(name); }


  public Matrix findOrCreateMatrix(String name) {
/*  67 */     Matrix matrix = (Matrix)this.m_matrixs.get(name);

/*  69 */     if (matrix == null) {
/*  70 */       synchronized (this.m_matrixs) {
/*  71 */         matrix = (Matrix)this.m_matrixs.get(name);

/*  73 */         if (matrix == null) {
/*  74 */           matrix = new Matrix(name);
/*  75 */           this.m_matrixs.put(name, matrix);
        }
      }
    }

/*  80 */     return matrix;
  }


/*  84 */   public String getDomain() { return this.m_domain; }



/*  88 */   public Set<String> getDomainNames() { return this.m_domainNames; }



/*  92 */   public Date getEndTime() { return this.m_endTime; }



/*  96 */   public Map<String, Matrix> getMatrixs() { return this.m_matrixs; }



/* 100 */   public Date getStartTime() { return this.m_startTime; }








  public void mergeAttributes(MatrixReport other) {
/* 114 */     assertAttributeEquals(other, "matrix-report", "domain", this.m_domain, other.getDomain());

/* 116 */     if (other.getStartTime() != null) {
/* 117 */       this.m_startTime = other.getStartTime();
    }

/* 120 */     if (other.getEndTime() != null) {
/* 121 */       this.m_endTime = other.getEndTime();
    }
  }


/* 126 */   public Matrix removeMatrix(String name) { return (Matrix)this.m_matrixs.remove(name); }


  public MatrixReport setDomain(String domain) {
/* 130 */     this.m_domain = domain;
/* 131 */     return this;
  }

  public MatrixReport setEndTime(Date endTime) {
/* 135 */     this.m_endTime = endTime;
/* 136 */     return this;
  }

  public MatrixReport setStartTime(Date startTime) {
/* 140 */     this.m_startTime = startTime;
/* 141 */     return this;
  }

  public MatrixReport() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/matrix/model/entity/MatrixReport.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */